#!/bin/bash
. digeksconfig

###
#  Mye i dette scriptet krever root tilgang, så vi kjører scriptet som root.
###
if [ "$(id -u)" != "0" ]; then
    echo "[-] This script must be run as root" 2>&1
    exit 1
fi

#
#
#

echo "[++] Starting with 00_target"
if [ $P00_BUILD_TARGET = "y" ] ; then
    ./bin/00_target.sh
fi

echo "[++] Starting with 01_build"
if [ $P01_BUILD_SOURCES = "y" ] ; then
    ./bin/01_build.sh
fi

echo "[++] Starting with 02_copy"
if [ $P02_COPY_FILES = "y" ] ; then
    ./bin/02_copy.sh
fi

echo "[++] Starting with 03_configure"
if [ $P03_CONFIGURE = "y" ] ; then
    ./bin/03_configure.sh
fi

echo "[++] Starting with 04_kernel"
if [ $P04_KERNEL = "y" ] ; then
    ./bin/04_kernel.sh
fi

echo "[++] Starting with 05_cleanup"
if [ $P05_CLEANUP = "y" ] ; then
    ./bin/05_cleanup.sh
fi

echo "[++] Starting with 06_mkusbimg"
if [ $P06_MKUSBIMG = "y" ] ; then
    ./bin/06_mkusbimg.sh
fi

echo "[++] Starting with 07_initrd"
if [ $P07_INITRD = "y" ] ; then
    ./bin/07_initrd.sh
fi


